package com.smartfactory.sail.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.smartfactory.sail.entity.Device;
import com.smartfactory.sail.entity.enums.DeviceStatusEnum;
import com.smartfactory.sail.vo.device.ListDeviceResp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 设备信息 Mapper 接口
 * </p>
 *
 * @author 王巨壁
 * @since 2019-07-24
 */
@Mapper
public interface DeviceMapper extends BaseMapper<Device> {
    IPage<ListDeviceResp> getPage(IPage<ListDeviceResp> page, @Param("ew") Wrapper<ListDeviceResp> queryWrapper);

    List<Device> getDeviceTypes();

    boolean updateNextMaintenanceDateById(@Param("id") Long id);

    void updateStatus(@Param("id") Long id, @Param("status") DeviceStatusEnum status);

    Integer getDeviceNum();
}
